/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bllInterface;

import java.io.Serializable;

/**
 *
 * @author salm
 */
public class FileMessage implements Serializable
{
    private FileMessage()
    {
    }
    
    private byte[] content;
    public byte[] getContent()
    {
        return content;
    }
    
    private String name;
    public String getName()
    {
        return name;
    }
    
    private String sender;
    public String getSender()
    {
        return sender;
    }
    
    private String receiver;
    public String getReceiver()
    {
        return receiver;
    }
    
    public static FileMessage createMessage(String sender, String fileName, byte[] content, String receiver)
    {
        FileMessage fm = new FileMessage();
        
        fm.setSender(sender);
        fm.setReceiver(receiver);
        fm.content  =   content;
        fm.name     =   fileName;
        
        return fm;
    }
    
    /**
     * @param sender the sender to set
     */
    public void setSender(String sender) {
        this.sender = sender;
    }

    /**
     * @param receiver the receiver to set
     */
    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }
    
    @Override
    public FileMessage clone()
    {
        FileMessage cloneMsg = new FileMessage();
        cloneMsg.sender = this.sender;
        cloneMsg.receiver = this.receiver;
        cloneMsg.content = this.content;
        
        return cloneMsg;
    }
}
